home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
010
/
sargeant.arc
/
752X410.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-09-12
|
4KB
|
171 lines
;------ VEGA HiRes (752x410) Data:
Vega_Seg segment at 0C000h ;VEGA ROM Segment
org 028h
mul8_addr label word ;Address of emulation routine
org 02Ah
version label byte ;Version string
org 03FFEh
feature label byte ;Feature flags
Vega_Seg ends
VerChk db 'VEGA BIOS Code, ',0 ;VEGA BIOS Version string subset
;
; Alt. Mode 10: 752 x 410 16-color graphics (>64k ram):
;
HiRes_Params label byte
db 80, 36, 14
dw 0B400h
db 001h, 00Fh, 000h, 006h
db 0ABh
db 076h, 05Dh, 061h, 031h, 061h, 00Dh
db 0A8h, 01Fh, 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h, 09Ah, 026h
db 099h, 02Fh, 00Fh, 09Bh, 008h, 0E3h
db 0FFh
db 000h, 001h, 002h, 003h, 004h, 005h
db 014h, 007h, 038h, 039h, 03Ah, 03Bh
db 03Ch, 03Dh, 03Eh, 03Fh, 001h, 000h
db 00Fh, 000h
db 000h, 000h, 000h, 000h, 000h, 000h
db 005h, 00Fh, 0FFh
Emulate label dword ;Far pointer to Emulate routine
EmulOff dw 0
EmulSeg dw 0
;------ End of VEGA Data...
;========================================================================
;------ VEGA HiRes (752x410) Code:
;
; Check EGA ROM for VEGA BIOS version string, and 24 Mhz clock feature
;
; Exit: Carry set: VEGA Deluxe found
; Carry clear: VEGA Deluxe not found
;
Check_Vega proc near
push ax ;Save regs
push bx
push cx
push si
push di
push ds
push es
cld ;Strings go forward
mov ah,12H ;Bios alternate select
mov bl,10H ;Return EGA information
int 10H
or bh,bh ;check for color monitor
jnz Chk_Fail ;if bh=1, mono monitor
push cs ;Copy code seg
pop ds ;into data seg.
mov ax,Vega_Seg ;Get VEGA ROM seg
mov es,ax ;copy into ES
assume es:Vega_Seg
lea di,version ;Point at ROM version string
lea si,VerChk ;Point at version string subset
Chk_Loop:
lodsb ;Get source byte
or al,al ;End of string?
jz Chk_Equal ;If at end, set carry (Equal)
cmp al,es:[di] ;Does this byte match?
jne Chk_Fail ;No, exit (Not Equal)
inc di ;Yes, advance dest pointer
jmp Chk_Loop ;Loop over source string
Chk_Fail:
clc ;else clear carry
jmp short Chk_Exit ;and exit
Chk_Equal:
test es:feature,1 ;Is this a "Deluxe" VEGA?
jz Chk_Fail ;No, can't do sexy hires modes
stc ;Yes, Set carry flag
Chk_Exit:
pop es ;Restore regs
assume es:Nothing
pop ds
assume ds:Nothing
pop di
pop si
pop cx
pop bx
pop ax
ret
Check_Vega endp
;
; Set VEGA HiRes (752x410) mode
;
Set_Hires proc near
push es ;Save registers
push bp
push di
push si
push dx
push bx
push ax
mov bx,Vega_Seg ;Setup to get Vega Segment
mov es,bx
assume es:Vega_Seg
mov bx,es:Mul8_addr ;Get offset of emulation routine
mov cs:EmulOff,bx ;Save offset
mov cs:EmulSeg,es ;and segment
push cs ;Copy code segment
pop es ;into ES
lea di,HiRes_Params ;Get address of HiRes parameters
mov dx,3D4h ;Get CRT port address
mov ax,9 ;Get special mode
call cs:Emulate ;Set EGA registers from param table
mov ax,040H ;Get the bios data segment
mov es,ax
mov word ptr es:[4AH],94 ;Set the number of columns
mov byte ptr es:[84H],28 ;Set the number of rows
call Pal_On ;Turn the palette on
pop ax ;Restore registers
pop bx
pop dx
pop si
pop di
pop bp
pop es
assume es:Nothing
ret ;Return
Set_Hires endp
;
; Turn Palette On
;
Pal_On proc near
mov dx,3DAh ;Get status port address (Color)...
in al,dx ;Set attribute flip-flop
mov dx,3C0h
mov al,20h
out dx,al ;Enable palette
ret
Pal_On endp
;------ End of VEGA Code...